package com.qutan.app.api.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;


/**
 */
@Configuration
public class BoneCPConfig {

    @Value("${mysql.druidDataSource.url}")
    private String jdbcUrl;

    @Value("${mysql.druidDataSource.username}")
    private String jdbcUsername;

    @Value("${mysql.druidDataSource.password}")
    private String jdbcPassword;

    @Bean
    public DataSource druidDataSource() {

        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setMaxActive(100);
        dataSource.setUrl(jdbcUrl);
        dataSource.setUsername(jdbcUsername);
        dataSource.setPassword(jdbcPassword);
        return dataSource;
    }


}
